/*
 * Utility.h
 *
 *  Created on: 13/mag/2013
 *      Author: Ialenti Andrea, Marangon Fabio
 */

#ifndef UTILITY_H_
#define UTILITY_H_

#include "Types.h"

//	Utility function used to initialize an array of 'double'.
double* initDblArray(int n);

//	Utility function used to free an array memory.
void freeDblArray(double *a);

//	Utility function used to initialize an array of integers.
int* initIntArray(int n);

//	Utility function used to free an array memory.
void freeIntArray(int *a);

//	Utility function used to initialize an array of 'char'.
char* initCharArray(int n);

//	Utility function used to free an array memory.
void freeCharArray(char *a);

//	Utility function used to initialize an array of 'Line'.
Line* initLineArray(int n);

//	Utility function used to free an array memory.
void freeLineArray(Line *a);

//	Utility function used to initialize a matrix.
int** initMat(int r, int c);

//	Utility function used to free a matrix memory.
void freeMat(int **mat, int r);

//	Utility function used to initialize adjacency matrix memory.
int** initAdjMat(int n);

//	Utility function used to reset the adjacency matrix.
void resetAdjMatVals(int **mat, int n);

//	Utility function used to free adjacency matrix memory.
void freeAdjMat(int **mat, int n);

//	Utility function used to swap two integers.
void swapInt(int *i, int *j);

//	Utility function used to swap two doubles.
void swapDbl(double *i, double *j);

#endif /* UTILITY_H_ */
